<template>
    <view class="page">
        <comHead :datas="datasObj"> <template #headerContent> </template> </comHead>

        <view class="content_box2 pd-30">
            <view class="card_box mb-30" v-for="list in optionsList" :key="list.value">
                <view class="ft-28 c-33 fw-800 ml-20">{{ list.label }} </view>
                <view class="tags_box mt-20" :class="list.value != 1 ? 'grid_5' : ''">
                    <view class="item" v-for="item in list.children" :key="item.id" @click="goPage(item.url)">
                        <view class="image_bg flex-center">

                            <image class="wh-36" :src="item.logo" mode="aspectFill" />
                        </view>
                        <text class="mt-10 ft-22 c-33 fw-800">{{ item.name }}</text>
                        <view class="en_text mt-10 ft-22 c-99 fw-900 text_center" v-if="list.value == 1">{{
                            item.en
                            }}</view>
                    </view>
                </view>
            </view>

        </view>
    </view>

</template>
<script setup lang="js">
import comHead from '@/components/comHead.vue';
import { onLoad } from '@dcloudio/uni-app';
import { ref, reactive } from 'vue';
import { utils } from '@/utils/utils.js';
import { api } from '@/utils/api.js';
let datasObj = reactive({
    title: '更多业务',
    img: '',
    color: '#FFFFFF',
    direction: '',
    scrollTop: 0,
    noBack: false,
    height: 88
})
const goPage = (url) => {
    uni.navigateTo({ url: url })
}
const optionsList = ref([])
const getBusinessList = () => {
    utils.request(api.getBusinessList, {
    }, "get").then(res => {
        optionsList.value = res.data.list
    })
}
onLoad(() => {
    getBusinessList()

})
</script>
<style lang="scss">
.btn_box {
    width: 100%;
    position: fixed;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
    background-color: #F8F8F8;
    padding-bottom: calc(10rpx + env(safe-area-inset-bottom));

    .center {
        width: 100%;
        text-align: center;
    }

    .btn_left {
        width: 132rpx;
        height: 54rpx;
        background: #FFFFFF;
        border-radius: 20rpx 20rpx 20rpx 20rpx;
        line-height: 54rpx;
        text-align: center;
    }

    .btn {
        width: 192rpx;
        height: 78rpx;
        background: #F1F1F1;
        border-radius: 20rpx 20rpx 20rpx 20rpx;
        text-align: center;
        line-height: 78rpx;
        font-size: 28rpx;

    }

    .box {
        padding: 20rpx 30rpx 0;
        box-sizing: border-box;
        height: 98rpx;


        .add {
            width: 100%;
            color: #DBF046;
            background-color: #333333;
        }

    }
}

.popup_box {
    height: 800rpx;
    display: flex;
    flex-direction: column;

    .header_pop {
        height: 100rpx;
        padding: 0 30rpx;
        font-size: 32rpx;
        color: #333;
        font-weight: 800;
    }

    .popup_content {
        // height: calc(800rpx - 230rpx);
        flex: 1 1 auto;
        display: flex;
        flex-wrap: wrap;
        // 多行对齐使用 align-content
        align-content: flex-start;
        justify-content: flex-start;
        gap: 20rpx;
        padding: 20rpx 30rpx 0;
        border-top: 2rpx solid #F1F1F1;
        border-bottom: 2rpx solid #F1F1F1;


        .items {
            height: 58rpx;
            line-height: 58rpx;
            padding: 0 20rpx;
            background: #333333;
            border-radius: 20rpx;
            font-size: 24rpx;
            color: #DBF046;
            text-align: center;
        }
    }

    .pop_btn {
        width: 448rpx;
        height: 78rpx;
        line-height: 78rpx;
        background: #333333;
        border-radius: 20rpx 20rpx 20rpx 20rpx;
        color: #DBF046;
        text-align: center;
        margin: 20rpx auto 0;

    }

}

.content_box2 {
    border-top: 2rpx solid #F1F1F1;
    background-color: #fff;


    .card_box {
        background-color: #fff;
        // margin: 30rpx 30rpx 0;
        border-radius: 40rpx;
        overflow: hidden;
        // padding: 30rpx 0;
        box-sizing: border-box;
    }

    .tags_box {
        // display: flex;
        // justify-content: flex-start;
        // // gap: 20rpx;
        // margin-top: 20rpx;
        // flex-wrap: wrap;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        /* 每行四列 */
        gap: 20rpx;
        /* 子盒子之间的间隙 */
        // padding-left: 10px;
        /* 左边缘空隙 */
        // padding-right: 10px;

        /* 右边缘空隙 */

        .item {
            flex: 1 1 4;
            padding: 20rpx 0;
            // background-color: #F1F1F1;
            // margin-right: 20rpx;
            border-radius: 20rpx;
            font-size: 24rpx;
            color: #666;
            display: flex;
            flex-direction: column;
            align-items: center;
            background: #F8F8F8;
            border-radius: 20rpx;
            // border: 1rpx solid #eee;

            .image_bg {
                background-color: #fff;
                width: 56rpx;
                height: 56rpx;
                border-radius: 50%;
            }

            .en_text {
                // padding: 0 8rpx;
                font-family: 'DIN COROS';
            }

        }

        .active {
            color: #DBF046;
            background-color: #333;
        }
    }

    .grid_5 {
        grid-template-columns: repeat(5, 1fr);

    }
}
</style>